﻿using System;
using EasyStep.Attributes;
using EasyStep.TestExecution.Data;
using EasyStep.TestExecution.Interfaces;
using OpenQA.Selenium;
using EasyStep.TestActions.Utils;

namespace EasyStep.TestActions.Actions.Wait
{
    [TestAction(typeof(Wait), Name = "Implicitly", RequireLocator=false)]
    class ImplicitWait : ITestAction<IWebDriver>
    {

        public void Execute(IWebDriver browser, TestStepResult data, IExecuteDataContext context)
        {
            browser.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromMilliseconds(Convert.ToInt32(data.Data)));
        }
    }
}
